#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
// clear && g++ 基本窗口和按钮.cpp -o hello_fltk `fltk-config --cxxflags --ldflags` && ./hello_fltk
class MyWindow : public Fl_Window
{
public:
    MyWindow(int W, int H, const char *l = 0) : Fl_Window(W, H, l)
    {
        Fl_Button *button = new Fl_Button(100, 100, 140, 40, "Click Me!");
        button->callback((Fl_Callback *)button_cb, this);
        end();
        show();
    }

    static void button_cb(Fl_Widget *, void *w)
    {
        MyWindow *window = (MyWindow *)w;
        window->label("Button was clicked!");
    }
};

int main(int argc, char **argv)
{
    MyWindow window(400, 300, "FLTK Example");
    return Fl::run();
}